package com.liuduidui.sh.feign;

import com.liuduidui.sh.fallback.UserFeignFallBackApi;
import com.liuduidui.sh.pojos.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "user-service", fallback = UserFeignFallBackApi.class)
public interface UserFeignApi {

    // 服务提供方提供接口方法
    //Feign 对SpringMVC注解增强
    @GetMapping("/user/{id}")
    User queryById(@PathVariable("id") String username);
}